package com.wmh.baseservice.user.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;

/**
 * @author mmx generator
 * @since 2021-10-28
 */
@ApiModel(value="User对象", description="")
public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String username;

    private String password;

    private String role;

    private String permission;

    private Integer ban;

    @ApiModelProperty(value = "随机盐")
    private String sale;

    public Integer getId() {
        return id;
    }

    public User setId(Integer id) {
        this.id = id;
        return this;
    }
    public String getUsername() {
        return username;
    }

    public User setUsername(String username) {
        this.username = username;
        return this;
    }
    public String getPassword() {
        return password;
    }

    public User setPassword(String password) {
        this.password = password;
        return this;
    }
    public String getRole() {
        return role;
    }

    public User setRole(String role) {
        this.role = role;
        return this;
    }
    public String getPermission() {
        return permission;
    }

    public User setPermission(String permission) {
        this.permission = permission;
        return this;
    }
    public Integer getBan() {
        return ban;
    }

    public User setBan(Integer ban) {
        this.ban = ban;
        return this;
    }
    public String getSale() {
        return sale;
    }

    public User setSale(String sale) {
        this.sale = sale;
        return this;
    }

    public static final String ID = "id";

    public static final String USERNAME = "username";

    public static final String PASSWORD = "password";

    public static final String ROLE = "role";

    public static final String PERMISSION = "permission";

    public static final String BAN = "ban";

    public static final String SALE = "sale";

    @Override
    public String toString() {
        return "User{" +
            "id=" + id +
            ", username=" + username +
            ", password=" + password +
            ", role=" + role +
            ", permission=" + permission +
            ", ban=" + ban +
            ", sale=" + sale +
        "}";
    }

    public final static String[] getFields(String ...noField){
        List<String> list = new ArrayList<>(Arrays.asList(
            User.ID
            ,User.USERNAME
            ,User.PASSWORD
            ,User.ROLE
            ,User.PERMISSION
            ,User.BAN
            ,User.SALE
        ));
        list.removeAll(new ArrayList<>(Arrays.asList(noField)));
        return list.toArray(new String[0]);
    }
}